Skip to content

Fix incremental overcompilation due to instabilities #2061

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 7, 2017

Conversation

smarter
Copy link
Member

@smarter smarter commented Mar 7, 2017

The output of ExtractAPI should be stable, otherwise sbt might
incorrectly conclude that some API changed because its hash is
different, even though the source hasn't changed. This commit fixes two
cases where this might happen:

  • package prefixes in NamedTypes are unstable, we already worked around this by
    normalizing them, but only for classes, we now always do it.
  • We use a simplified representation for _ >: Nothing <: Any, this is
    now checked using isDirectRef instead of referential equality on types
    since there is more than one way to represent Nothing and Any.

The output of ExtractAPI should be stable, otherwise sbt might
incorrectly conclude that some API changed because its hash is
different, even though the source hasn't changed. This commit fixes two
cases where this might happen:
- package prefixes in NamedTypes are unstable, we already worked around this by
  normalizing them, but only for classes, we now always do it.
- We use a simplified representation for `_ >: Nothing <: Any`, this is
  now checked using `isDirectRef` instead of referential equality on types
  since there is more than one way to represent `Nothing` and `Any`.

Both of these issues were found while compiling dotty with
`dotty-compiler-bootstrapped/compile` and making small changes.
Copy link
Contributor

@felixmulder felixmulder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@smarter smarter merged commit 3c4d29e into scala:master Mar 7, 2017
@allanrenucci allanrenucci deleted the fix/overcompilation-api branch December 14, 2017 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants